<template>
    <div class="indicators-row">
      <div class="indicator-card" v-for="(item, index) in indicators" :key="index">
        <div class="indicator-title">{{ item.label }}</div>
        <div class="indicator-value">{{ item.value }}</div>
      </div>
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  
  const props = defineProps({
    indicators: {
      type: Array,
      default: () => [
        { label: '总产量', value: '12,580' },
        { label: '合格率', value: '99.2%' },
        { label: '设备利用率', value: '87.5%' },
        { label: '能耗', value: '3,245kWh' },
        { label: '工单完成率', value: '92.3%' },
        { label: '异常次数', value: '3' }
      ]
    }
  });
  </script>
  
  <style scoped>
  /* 指标行容器：顶部和左右padding，无底部padding */
  .indicators-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 10px;
    box-sizing: border-box;
  }
  
  /* 指标卡片样式 */
  .indicator-card {
    background: linear-gradient(145deg, rgba(10, 42, 102, 0.4), rgba(5, 26, 64, 0.6));
    border-radius: 8px;
    padding: 1vw 1vw 1.2vw; /* 上下内边距微调，保持视觉平衡 */
    box-shadow: 
      0 4px 12px rgba(0, 20, 60, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(66, 165, 245, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
  }
  
  /* 卡片顶部微光装饰 */
  .indicator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(66, 165, 245, 0.6), transparent);
  }
  
  /* 悬停效果 */
  .indicator-card:hover {
    transform: translateY(-3px);
    box-shadow: 
      0 6px 16px rgba(0, 20, 60, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(66, 165, 245, 0.25);
  }
  
  /* 指标标题 */
  .indicator-title {
    font-size: 0.9vw;
    color: #b8d0eb;
    letter-spacing: 0.05vw;
    margin-bottom: 0.3vw;
  }
  
  /* 指标数值 */
  .indicator-value {
    font-size: 1.8vw;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.08vw;
    text-shadow: 0 0 8px rgba(66, 165, 245, 0.2);
  }
  </style>